home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Tool Chest / Development Kits / MPW etc. / MPW-GM / Interfaces&Libraries / Interfaces / CIncludes / ImageCodec.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-17  |  46.8 KB  |  1,405 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ImageCodec.h
  3.  
  4.      Contains:    QuickTime Interfaces.
  5.  
  6.      Version:    Technology:    QuickTime 3.0
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1990-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __IMAGECODEC__
  19. #define __IMAGECODEC__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __QUICKDRAW__
  25. #include <Quickdraw.h>
  26. #endif
  27. #ifndef __IMAGECOMPRESSION__
  28. #include <ImageCompression.h>
  29. #endif
  30. #ifndef __COMPONENTS__
  31. #include <Components.h>
  32. #endif
  33. #ifndef __MOVIES__
  34. #include <Movies.h>
  35. #endif
  36. #ifndef __GXTYPES__
  37. #include <GXTypes.h>
  38. #endif
  39.  
  40.  
  41.  
  42. #if PRAGMA_ONCE
  43. #pragma once
  44. #endif
  45.  
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49.  
  50. #if PRAGMA_IMPORT
  51. #pragma import on
  52. #endif
  53.  
  54. #if PRAGMA_STRUCT_ALIGN
  55.     #pragma options align=mac68k
  56. #elif PRAGMA_STRUCT_PACKPUSH
  57.     #pragma pack(push, 2)
  58. #elif PRAGMA_STRUCT_PACK
  59.     #pragma pack(2)
  60. #endif
  61.  
  62.  
  63. /*    codec capabilities flags    */
  64.  
  65. enum {
  66.     codecCanScale                = 1L << 0,
  67.     codecCanMask                = 1L << 1,
  68.     codecCanMatte                = 1L << 2,
  69.     codecCanTransform            = 1L << 3,
  70.     codecCanTransferMode        = 1L << 4,
  71.     codecCanCopyPrev            = 1L << 5,
  72.     codecCanSpool                = 1L << 6,
  73.     codecCanClipVertical        = 1L << 7,
  74.     codecCanClipRectangular        = 1L << 8,
  75.     codecCanRemapColor            = 1L << 9,
  76.     codecCanFastDither            = 1L << 10,
  77.     codecCanSrcExtract            = 1L << 11,
  78.     codecCanCopyPrevComp        = 1L << 12,
  79.     codecCanAsync                = 1L << 13,
  80.     codecCanMakeMask            = 1L << 14,
  81.     codecCanShift                = 1L << 15,
  82.     codecCanAsyncWhen            = 1L << 16,
  83.     codecCanShieldCursor        = 1L << 17,
  84.     codecCanManagePrevBuffer    = 1L << 18,
  85.     codecHasVolatileBuffer        = 1L << 19,
  86.     codecWantsRegionMask        = 1L << 20,
  87.     codecImageBufferIsOnScreen    = 1L << 21,
  88.     codecWantsDestinationPixels    = 1L << 22,
  89.     codecWantsSpecialScaling    = 1L << 23,
  90.     codecHandlesInputs            = 1L << 24,
  91.     codecCanDoIndirectSurface    = 1L << 25,
  92.     codecIsSequenceSensitive    = 1L << 26,
  93.     codecRequiresOffscreen        = 1L << 27,
  94.     codecRequiresMaskBits        = 1L << 28,
  95.     codecCanRemapResolution        = 1L << 29,
  96.     codecIsDirectToScreenOnly    = 1L << 30,
  97.     codecCanLockSurface            = 1L << 31
  98. };
  99.  
  100.  
  101. struct CodecCapabilities {
  102.     long                             flags;
  103.     short                             wantedPixelSize;
  104.     short                             extendWidth;
  105.     short                             extendHeight;
  106.     short                             bandMin;
  107.     short                             bandInc;
  108.     short                             pad;
  109.     unsigned long                     time;
  110. };
  111. typedef struct CodecCapabilities        CodecCapabilities;
  112. /*    codec condition flags    */
  113.  
  114. enum {
  115.     codecConditionFirstBand        = 1L << 0,
  116.     codecConditionLastBand        = 1L << 1,
  117.     codecConditionFirstFrame    = 1L << 2,
  118.     codecConditionNewDepth        = 1L << 3,
  119.     codecConditionNewTransform    = 1L << 4,
  120.     codecConditionNewSrcRect    = 1L << 5,
  121.     codecConditionNewMask        = 1L << 6,
  122.     codecConditionNewMatte        = 1L << 7,
  123.     codecConditionNewTransferMode = 1L << 8,
  124.     codecConditionNewClut        = 1L << 9,
  125.     codecConditionNewAccuracy    = 1L << 10,
  126.     codecConditionNewDestination = 1L << 11,
  127.     codecConditionFirstScreen    = 1L << 12,
  128.     codecConditionDoCursor        = 1L << 13,
  129.     codecConditionCatchUpDiff    = 1L << 14,
  130.     codecConditionMaskMayBeChanged = 1L << 15,
  131.     codecConditionToBuffer        = 1L << 16,
  132.     codecConditionCodecChangedMask = 1L << 31
  133. };
  134.  
  135.  
  136.  
  137. enum {
  138.     codecInfoResourceType        = FOUR_CHAR_CODE('cdci'),        /* codec info resource type */
  139.     codecInterfaceVersion        = 2                                /* high word returned in component GetVersion */
  140. };
  141.  
  142.  
  143. struct CDSequenceDataSourceQueueEntry {
  144.     void *                            nextBusy;
  145.  
  146.     long                             descSeed;
  147.     Handle                             dataDesc;
  148.     void *                            data;
  149.     long                             dataSize;
  150.  
  151.     long                             useCount;
  152.  
  153.     TimeValue                         frameTime;
  154.     TimeValue                         frameDuration;
  155.     TimeValue                         timeScale;
  156. };
  157. typedef struct CDSequenceDataSourceQueueEntry CDSequenceDataSourceQueueEntry;
  158. typedef CDSequenceDataSourceQueueEntry * CDSequenceDataSourceQueueEntryPtr;
  159.  
  160. struct CDSequenceDataSource {
  161.     long                             recordSize;
  162.  
  163.     void *                            next;
  164.  
  165.     ImageSequence                     seqID;
  166.     ImageSequenceDataSource         sourceID;
  167.     OSType                             sourceType;
  168.     long                             sourceInputNumber;
  169.     void *                            dataPtr;
  170.     Handle                             dataDescription;
  171.     long                             changeSeed;
  172.     ICMConvertDataFormatUPP         transferProc;
  173.     void *                            transferRefcon;
  174.     long                             dataSize;
  175.  
  176.                                                                 /* fields available in QT 3 and later */
  177.  
  178.     QHdrPtr                         dataQueue;                    /* queue of CDSequenceDataSourceQueueEntry structures*/
  179.  
  180.     void *                            originalDataPtr;
  181.     long                             originalDataSize;
  182.     Handle                             originalDataDescription;
  183.     long                             originalDataDescriptionSeed;
  184. };
  185. typedef struct CDSequenceDataSource        CDSequenceDataSource;
  186. typedef CDSequenceDataSource *            CDSequenceDataSourcePtr;
  187.  
  188. struct ICMFrameTimeInfo {
  189.     wide                             startTime;
  190.     long                             scale;
  191.     long                             duration;
  192. };
  193. typedef struct ICMFrameTimeInfo            ICMFrameTimeInfo;
  194. typedef ICMFrameTimeInfo *                ICMFrameTimeInfoPtr;
  195.  
  196. struct CodecCompressParams {
  197.     ImageSequence                     sequenceID;                    /* precompress,bandcompress */
  198.     ImageDescriptionHandle             imageDescription;            /* precompress,bandcompress */
  199.     Ptr                             data;
  200.     long                             bufferSize;
  201.     long                             frameNumber;
  202.     long                             startLine;
  203.     long                             stopLine;
  204.     long                             conditionFlags;
  205.     CodecFlags                         callerFlags;
  206.     CodecCapabilities *                capabilities;                /* precompress,bandcompress */
  207.     ICMProgressProcRecord             progressProcRecord;
  208.     ICMCompletionProcRecord         completionProcRecord;
  209.     ICMFlushProcRecord                 flushProcRecord;
  210.  
  211.     PixMap                             srcPixMap;                    /* precompress,bandcompress */
  212.     PixMap                             prevPixMap;
  213.     CodecQ                             spatialQuality;
  214.     CodecQ                             temporalQuality;
  215.     Fixed                             similarity;
  216.     DataRateParamsPtr                 dataRateParams;
  217.     long                             reserved;
  218.  
  219.                                                                 /* The following fields only exist for QuickTime 2.1 and greater */
  220.     UInt16                             majorSourceChangeSeed;
  221.     UInt16                             minorSourceChangeSeed;
  222.     CDSequenceDataSourcePtr         sourceData;
  223.  
  224.                                                                 /* The following fields only exit for QuickTime 2.5 and greater */
  225.     long                             preferredPacketSizeInBytes;
  226.  
  227.                                                                 /* The following fields only exit for QuickTime 3.0 and greater */
  228.     long                             requestedBufferWidth;        /* must set codecWantsSpecialScaling to indicate this field is valid*/
  229.     long                             requestedBufferHeight;        /* must set codecWantsSpecialScaling to indicate this field is valid*/
  230. };
  231. typedef struct CodecCompressParams        CodecCompressParams;
  232.  
  233. struct CodecDecompressParams {
  234.     ImageSequence                     sequenceID;                    /* predecompress,banddecompress */
  235.     ImageDescriptionHandle             imageDescription;            /* predecompress,banddecompress */
  236.     Ptr                             data;
  237.     long                             bufferSize;
  238.     long                             frameNumber;
  239.     long                             startLine;
  240.     long                             stopLine;
  241.     long                             conditionFlags;
  242.     CodecFlags                         callerFlags;
  243.     CodecCapabilities *                capabilities;                /* predecompress,banddecompress */
  244.     ICMProgressProcRecord             progressProcRecord;
  245.     ICMCompletionProcRecord         completionProcRecord;
  246.     ICMDataProcRecord                 dataProcRecord;
  247.  
  248.     CGrafPtr                         port;                        /* predecompress,banddecompress */
  249.     PixMap                             dstPixMap;                    /* predecompress,banddecompress */
  250.     BitMapPtr                         maskBits;
  251.     PixMapPtr                         mattePixMap;
  252.     Rect                             srcRect;                    /* predecompress,banddecompress */
  253.     MatrixRecord *                    matrix;                        /* predecompress,banddecompress */
  254.     CodecQ                             accuracy;                    /* predecompress,banddecompress */
  255.     short                             transferMode;                /* predecompress,banddecompress */
  256.     ICMFrameTimePtr                 frameTime;                    /* banddecompress */
  257.     long                             reserved[1];
  258.                                                                 /* The following fields only exist for QuickTime 2.0 and greater */
  259.     SInt8                             matrixFlags;                /* high bit set if 2x resize */
  260.     SInt8                             matrixType;
  261.     Rect                             dstRect;                    /* only valid for simple transforms */
  262.                                                                 /* The following fields only exist for QuickTime 2.1 and greater */
  263.     UInt16                             majorSourceChangeSeed;
  264.     UInt16                             minorSourceChangeSeed;
  265.     CDSequenceDataSourcePtr         sourceData;
  266.  
  267.     RgnHandle                         maskRegion;
  268.  
  269.                                                                 /* The following fields only exist for QuickTime 2.5 and greater */
  270.  
  271.     OSType **                        wantedDestinationPixelTypes; /* Handle to 0-terminated list of OSTypes */
  272.  
  273.     long                             screenFloodMethod;
  274.     long                             screenFloodValue;
  275.     short                             preferredOffscreenPixelSize;
  276.  
  277.                                                                 /* The following fields only exist for QuickTime 3.0 and greater */
  278.     ICMFrameTimeInfoPtr             syncFrameTime;                /* banddecompress */
  279.     Boolean                         needUpdateOnTimeChange;        /* banddecompress */
  280.     Boolean                         enableBlackLining;
  281.     Boolean                         needUpdateOnSourceChange;    /* band decompress */
  282.     Boolean                         pad;
  283.  
  284.     long                             unused;
  285.  
  286.     CGrafPtr                         finalDestinationPort;
  287.  
  288.     long                             requestedBufferWidth;        /* must set codecWantsSpecialScaling to indicate this field is valid*/
  289.     long                             requestedBufferHeight;        /* must set codecWantsSpecialScaling to indicate this field is valid*/
  290. };
  291. typedef struct CodecDecompressParams    CodecDecompressParams;
  292.  
  293. enum {
  294.     matrixFlagScale2x            = 1L << 7,
  295.     matrixFlagScale1x            = 1L << 6,
  296.     matrixFlagScaleHalf            = 1L << 5
  297. };
  298.  
  299.  
  300. enum {
  301.     kScreenFloodMethodNone        = 0,
  302.     kScreenFloodMethodKeyColor    = 1,
  303.     kScreenFloodMethodAlpha        = 2
  304. };
  305.  
  306.  
  307. enum {
  308.     kFlushLastQueuedFrame        = 0,
  309.     kFlushFirstQueuedFrame        = 1
  310. };
  311.  
  312.  
  313. enum {
  314.     kNewImageGWorldErase        = 1L << 0
  315. };
  316.  
  317.  
  318. struct ImageSubCodecDecompressCapabilities {
  319.     long                             recordSize;                    /* sizeof(ImageSubCodecDecompressCapabilities)*/
  320.     long                             decompressRecordSize;        /* size of your codec's decompress record*/
  321.     Boolean                         canAsync;                    /* default true*/
  322.     UInt8                             pad[3];
  323. };
  324. typedef struct ImageSubCodecDecompressCapabilities ImageSubCodecDecompressCapabilities;
  325.  
  326. enum {
  327.     kCodecFrameTypeUnknown        = 0,
  328.     kCodecFrameTypeKey            = 1,
  329.     kCodecFrameTypeDifference    = 2,
  330.     kCodecFrameTypeDroppableDifference = 3
  331. };
  332.  
  333.  
  334. struct ImageSubCodecDecompressRecord {
  335.     Ptr                             baseAddr;
  336.     long                             rowBytes;
  337.     Ptr                             codecData;
  338.     ICMProgressProcRecord             progressProcRecord;
  339.     ICMDataProcRecord                 dataProcRecord;
  340.     void *                            userDecompressRecord;        /* pointer to codec-specific per-band data*/
  341.     UInt8                             frameType;
  342.     UInt8                             pad[3];
  343. };
  344. typedef struct ImageSubCodecDecompressRecord ImageSubCodecDecompressRecord;
  345. /* name of parameters or effect -- placed in root container, optional */
  346.  
  347. enum {
  348.     kParameterTitleName            = FOUR_CHAR_CODE('name'),
  349.     kParameterTitleID            = 1
  350. };
  351.  
  352. /* name of parameters or effect -- placed in root container, required */
  353.  
  354. enum {
  355.     kParameterWhatName            = FOUR_CHAR_CODE('what'),
  356.     kParameterWhatID            = 1
  357. };
  358.  
  359. /* is effect repeatable -- placed in root container, optional, default is TRUE*/
  360.  
  361. enum {
  362.     kParameterRepeatableName    = FOUR_CHAR_CODE('pete'),
  363.     kParameterRepeatableID        = 1
  364. };
  365.  
  366.  
  367. enum {
  368.     kParameterRepeatableTrue    = 1,
  369.     kParameterRepeatableFalse    = 0
  370. };
  371.  
  372. /* substitution codec in case effect is missing -- placed in root container, recommended */
  373.  
  374. enum {
  375.     kParameterAlternateCodecName = FOUR_CHAR_CODE('subs'),
  376.     kParameterAlternateCodecID    = 1
  377. };
  378.  
  379. /* maximum number of sources -- placed in root container, required */
  380.  
  381. enum {
  382.     kParameterSourceCountName    = FOUR_CHAR_CODE('srcs'),
  383.     kParameterSourceCountID        = 1
  384. };
  385.  
  386.  
  387.  
  388. enum {
  389.     kParameterDependencyName    = FOUR_CHAR_CODE('deep'),
  390.     kParameterDependencyID        = 1
  391. };
  392.  
  393.  
  394. enum {
  395.     kParameterListDependsUponColorProfiles = FOUR_CHAR_CODE('prof'),
  396.     kParameterListDependsUponFonts = FOUR_CHAR_CODE('font')
  397. };
  398.  
  399.  
  400. struct ParameterDependancyRecord {
  401.     long                             dependCount;
  402.     OSType                             depends[1];
  403. };
  404. typedef struct ParameterDependancyRecord ParameterDependancyRecord;
  405. /*
  406.    enumeration list in container -- placed in root container, optional unless used by a
  407.    parameter in the list
  408. */
  409.  
  410. enum {
  411.     kParameterEnumList            = FOUR_CHAR_CODE('enum')
  412. };
  413.  
  414.  
  415. struct EnumValuePair {
  416.     long                             value;
  417.     Str255                             name;
  418. };
  419. typedef struct EnumValuePair            EnumValuePair;
  420.  
  421. struct EnumListRecord {
  422.     long                             enumCount;                    /* number of enumeration items to follow*/
  423.     EnumValuePair                     values[1];                    /* values and names for them, packed */
  424. };
  425. typedef struct EnumListRecord            EnumListRecord;
  426. /* atom type of parameter*/
  427.  
  428. enum {
  429.     kParameterAtomTypeAndID        = FOUR_CHAR_CODE('type')
  430. };
  431.  
  432.  
  433. enum {
  434.     kNoAtom                        = FOUR_CHAR_CODE('none'),        /* atom type for no data got/set*/
  435.     kAtomNoFlags                = 0x00000000,
  436.     kAtomNotInterpolated        = 0x00000001,                    /* atom can never be interpolated*/
  437.     kAtomInterpolateIsOptional    = 0x00000002                    /* atom can be interpolated, but it is an advanced user operation*/
  438. };
  439.  
  440.  
  441. struct ParameterAtomTypeAndID {
  442.     QTAtomType                         atomType;                    /* type of atom this data comes from/goes into*/
  443.     QTAtomID                         atomID;                        /* ID of atom this data comes from/goes into*/
  444.     long                             atomFlags;                    /* options for this atom*/
  445.     Str255                             atomName;                    /* name of this value type*/
  446. };
  447. typedef struct ParameterAtomTypeAndID    ParameterAtomTypeAndID;
  448. /* data type of a parameter*/
  449.  
  450. enum {
  451.     kParameterDataType            = FOUR_CHAR_CODE('data')
  452. };
  453.  
  454.  
  455. enum {
  456.     kParameterTypeDataLong        = kTweenTypeLong,                /* integer value*/
  457.     kParameterTypeDataFixed        = kTweenTypeFixed,                /* fixed point value*/
  458.     kParameterTypeDataRGBValue    = kTweenTypeRGBColor,            /* RGBColor data*/
  459.     kParameterTypeDataDouble    = kTweenTypeQTFloatDouble,        /* IEEE 64 bit floating point value*/
  460.     kParameterTypeDataText        = FOUR_CHAR_CODE('text'),        /* editable text item*/
  461.     kParameterTypeDataEnum        = FOUR_CHAR_CODE('enum'),        /* enumerated lookup value*/
  462.     kParameterTypeDataBitField    = FOUR_CHAR_CODE('bool'),        /* bit field value (something that holds boolean(s))*/
  463.     kParameterTypeDataImage        = FOUR_CHAR_CODE('imag')        /* reference to an image via Picture data*/
  464. };
  465.  
  466.  
  467. struct ParameterDataType {
  468.     OSType                             dataType;                    /* type of data this item is stored as*/
  469. };
  470. typedef struct ParameterDataType        ParameterDataType;
  471. /*
  472.    alternate (optional) data type -- main data type always required.  
  473.    Must be modified or deleted when modifying main data type.
  474.    Main data type must be modified when alternate is modified.
  475. */
  476.  
  477. enum {
  478.     kParameterAlternateDataType    = FOUR_CHAR_CODE('alt1'),
  479.     kParameterTypeDataColorValue = FOUR_CHAR_CODE('cmlr'),        /* CMColor data (supported on machines with ColorSync)*/
  480.     kParameterTypeDataCubic        = FOUR_CHAR_CODE('cubi'),        /* cubic bezier(s) (no built-in support)*/
  481.     kParameterTypeDataNURB        = FOUR_CHAR_CODE('nurb')        /* nurb(s) (no built-in support)*/
  482. };
  483.  
  484.  
  485. struct ParameterAlternateDataEntry {
  486.     OSType                             dataType;                    /* type of data this item is stored as*/
  487.     QTAtomType                         alternateAtom;                /* where to store*/
  488. };
  489. typedef struct ParameterAlternateDataEntry ParameterAlternateDataEntry;
  490.  
  491. struct ParameterAlternateDataType {
  492.     long                             numEntries;
  493.     ParameterAlternateDataEntry     entries[1];
  494. };
  495. typedef struct ParameterAlternateDataType ParameterAlternateDataType;
  496. /* legal values for the parameter*/
  497.  
  498. enum {
  499.     kParameterDataRange            = FOUR_CHAR_CODE('rang')
  500. };
  501.  
  502.  
  503. enum {
  504.     kNoMinimumLongFixed            = 0x7FFFFFFF,                    /* ignore minimum/maxiumum values*/
  505.     kNoMaximumLongFixed            = (long)0x80000000,
  506.     kNoScaleLongFixed            = 0,                            /* don't perform any scaling of value*/
  507.     kNoPrecision                = (-1)                            /* allow as many digits as format*/
  508. };
  509.  
  510. /* 'text'*/
  511.  
  512. struct StringRangeRecord {
  513.     long                             maxChars;                    /* maximum length of string*/
  514.     long                             maxLines;                    /* number of editing lines to use (1 typical, 0 to default)*/
  515. };
  516. typedef struct StringRangeRecord        StringRangeRecord;
  517. /* 'long'*/
  518.  
  519. struct LongRangeRecord {
  520.     long                             minValue;                    /* no less than this*/
  521.     long                             maxValue;                    /* no more than this*/
  522.     long                             scaleValue;                    /* muliply content by this going in, divide going out*/
  523.     long                             precisionDigits;            /* # digits of precision when editing via typing*/
  524. };
  525. typedef struct LongRangeRecord            LongRangeRecord;
  526. /* 'enum'*/
  527.  
  528. struct EnumRangeRecord {
  529.     long                             enumID;                        /* 'enum' list in root container to search within*/
  530. };
  531. typedef struct EnumRangeRecord            EnumRangeRecord;
  532. /* 'fixd'*/
  533.  
  534. struct FixedRangeRecord {
  535.     Fixed                             minValue;                    /* no less than this*/
  536.     Fixed                             maxValue;                    /* no more than this*/
  537.     Fixed                             scaleValue;                    /* muliply content by this going in, divide going out*/
  538.     long                             precisionDigits;            /* # digits of precision when editing via typing*/
  539. };
  540. typedef struct FixedRangeRecord            FixedRangeRecord;
  541. /* 'doub'*/
  542.  
  543.     #define kNoMinimumDouble        (NAN)                    // ignore minimum/maxiumum values
  544.     #define kNoMaximumDouble        (NAN)
  545.     #define kNoScaleDouble            (0)                        // don't perform any scaling of value
  546.     struct DoubleRangeRecord
  547.         {
  548.         QTFloatDouble        minValue;            // no less than this
  549.         QTFloatDouble        maxValue;            // no more than this
  550.         QTFloatDouble        scaleValue;            // muliply content by this going in, divide going out
  551.         long                precisionDigits;    // # digits of precision when editing via typing
  552.         };
  553.     typedef struct DoubleRangeRecord DoubleRangeRecord;
  554.     
  555. /* 'bool'    */
  556.  
  557. struct BooleanRangeRecord {
  558.     long                             maskValue;                    /* value to mask on/off to set/clear the boolean*/
  559. };
  560. typedef struct BooleanRangeRecord        BooleanRangeRecord;
  561. /* 'rgb '*/
  562.  
  563. struct RGBRangeRecord {
  564.     RGBColor                         minColor;
  565.     RGBColor                         maxColor;
  566. };
  567. typedef struct RGBRangeRecord            RGBRangeRecord;
  568. /* 'imag'*/
  569.  
  570. enum {
  571.     kParameterImageNoFlags        = 0
  572. };
  573.  
  574.  
  575. struct ImageRangeRecord {
  576.     long                             imageFlags;
  577. };
  578. typedef struct ImageRangeRecord            ImageRangeRecord;
  579. /* union of all of the above*/
  580.  
  581.     struct ParameterRangeRecord
  582.         {
  583.         union 
  584.             {
  585.             LongRangeRecord        longRange;
  586.             EnumRangeRecord        enumRange;
  587.             FixedRangeRecord    fixedRange;
  588.             DoubleRangeRecord    doubleRange;
  589.             StringRangeRecord    stringRange;
  590.             BooleanRangeRecord    booleanRange;
  591.             RGBRangeRecord        rgbRange;
  592.             ImageRangeRecord    imageRange;
  593.             } u;
  594.         };
  595.     typedef struct ParameterRangeRecord ParameterRangeRecord;
  596.     
  597. /* UI behavior of a parameter*/
  598.  
  599. enum {
  600.     kParameterDataBehavior        = FOUR_CHAR_CODE('ditl')
  601. };
  602.  
  603.  
  604. enum {
  605.                                                                 /* items edited via typing*/
  606.     kParameterItemEditText        = FOUR_CHAR_CODE('edit'),        /* edit text box*/
  607.     kParameterItemEditLong        = FOUR_CHAR_CODE('long'),        /* long number editing box*/
  608.     kParameterItemEditFixed        = FOUR_CHAR_CODE('fixd'),        /* fixed point number editing box*/
  609.     kParameterItemEditDouble    = FOUR_CHAR_CODE('doub'),        /* double number editing box*/
  610.                                                                 /* items edited via control(s)*/
  611.     kParameterItemPopUp            = FOUR_CHAR_CODE('popu'),        /* pop up value for enum types*/
  612.     kParameterItemRadioCluster    = FOUR_CHAR_CODE('radi'),        /* radio cluster for enum types*/
  613.     kParameterItemCheckBox        = FOUR_CHAR_CODE('chex'),        /* check box for booleans*/
  614.     kParameterItemControl        = FOUR_CHAR_CODE('cntl'),        /* item controlled via a standard control of some type*/
  615.                                                                 /* special user items*/
  616.     kParameterItemLine            = FOUR_CHAR_CODE('line'),        /* line*/
  617.     kParameterItemColorPicker    = FOUR_CHAR_CODE('pick'),        /* color swatch & picker*/
  618.     kParameterItemGroupDivider    = FOUR_CHAR_CODE('divi'),        /* start of a new group of items*/
  619.     kParameterItemStaticText    = FOUR_CHAR_CODE('stat'),        /* display "parameter name" as static text*/
  620.     kParameterItemDragImage        = FOUR_CHAR_CODE('imag'),        /* allow image display, along with drag and drop*/
  621.                                                                 /* flags valid for lines and groups*/
  622.     kGraphicsNoFlags            = 0x00000000,                    /* no options for graphics*/
  623.     kGraphicsFlagsGray            = 0x00000001,                    /* draw lines with gray*/
  624.                                                                 /* flags valid for groups*/
  625.     kGroupNoFlags                = 0x00000000,                    /* no options for group -- may be combined with graphics options                        */
  626.     kGroupAlignText                = 0x00010000,                    /* edit text items in group have the same size*/
  627.     kGroupSurroundBox            = 0x00020000,                    /* group should be surrounded with a box*/
  628.     kGroupMatrix                = 0x00040000,                    /* side-by-side arrangement of group is okay*/
  629.     kGroupNoName                = 0x00080000,                    /* name of group should not be displayed above box*/
  630.                                                                 /* flags valid for popup/radiocluster/checkbox/control*/
  631.     kDisableControl                = 0x00000001,
  632.     kDisableWhenNotEqual        = (0x00000000 + kDisableControl),
  633.     kDisableWhenEqual            = (0x00000010 + kDisableControl),
  634.     kDisableWhenLessThan        = (0x00000020 + kDisableControl),
  635.     kDisableWhenGreaterThan        = (0x00000030 + kDisableControl), /* flags valid for popups*/
  636.     kPopupStoreAsString            = 0x00010000
  637. };
  638.  
  639.  
  640. struct ControlBehaviors {
  641.     QTAtomID                         groupID;                    /* group under control of this item*/
  642.     long                             controlValue;                /* control value for comparison purposes*/
  643. };
  644. typedef struct ControlBehaviors            ControlBehaviors;
  645.  
  646. struct ParameterDataBehavior {
  647.     OSType                             behaviorType;
  648.     long                             behaviorFlags;
  649.     union {
  650.         ControlBehaviors                 controls;
  651.     }                                 u;
  652. };
  653. typedef struct ParameterDataBehavior    ParameterDataBehavior;
  654. /* higher level purpose of a parameter or set of parameters*/
  655.  
  656. enum {
  657.     kParameterDataUsage            = FOUR_CHAR_CODE('use ')
  658. };
  659.  
  660.  
  661. enum {
  662.     kParameterUsagePixels        = FOUR_CHAR_CODE('pixl'),
  663.     kParameterUsageRectangle    = FOUR_CHAR_CODE('rect'),
  664.     kParameterUsagePoint        = FOUR_CHAR_CODE('xy  '),
  665.     kParameterUsage3DPoint        = FOUR_CHAR_CODE('xyz '),
  666.     kParameterUsageDegrees        = FOUR_CHAR_CODE('degr'),
  667.     kParameterUsageRadians        = FOUR_CHAR_CODE('rads'),
  668.     kParameterUsagePercent        = FOUR_CHAR_CODE('pcnt'),
  669.     kParameterUsageSeconds        = FOUR_CHAR_CODE('secs'),
  670.     kParameterUsageMilliseconds    = FOUR_CHAR_CODE('msec'),
  671.     kParameterUsageMicroseconds    = FOUR_CHAR_CODE('µsec'),
  672.     kParameterUsage3by3Matrix    = FOUR_CHAR_CODE('3by3')
  673. };
  674.  
  675.  
  676. struct ParameterDataUsage {
  677.     OSType                             usageType;                    /* higher level purpose of the data or group*/
  678. };
  679. typedef struct ParameterDataUsage        ParameterDataUsage;
  680. /* default value(s) for a parameter*/
  681.  
  682. enum {
  683.     kParameterDataDefaultItem    = FOUR_CHAR_CODE('dflt')
  684. };
  685.  
  686. /* atoms that help to fill in data within the info window */
  687.  
  688. enum {
  689.     kParameterInfoLongName        = FOUR_CHAR_CODE('©nam'),
  690.     kParameterInfoCopyright        = FOUR_CHAR_CODE('©cpy'),
  691.     kParameterInfoDescription    = FOUR_CHAR_CODE('©inf'),
  692.     kParameterInfoWindowTitle    = FOUR_CHAR_CODE('©wnt'),
  693.     kParameterInfoPicture        = FOUR_CHAR_CODE('©pix'),
  694.     kParameterInfoIDs            = 1
  695. };
  696.  
  697. /* flags for ImageCodecValidateParameters */
  698.  
  699. enum {
  700.     kParameterValidationNoFlags    = 0x00000000,
  701.     kParameterValidationFinalValidation = 0x00000001
  702. };
  703.  
  704.  
  705. typedef long                             QTParameterValidationOptions;
  706. /* QTAtomTypes for atoms in image compressor settings containers*/
  707.  
  708. enum {
  709.     kImageCodecSettingsFieldCount = FOUR_CHAR_CODE('fiel'),        /* Number of fields (UInt8) */
  710.     kImageCodecSettingsFieldOrdering = FOUR_CHAR_CODE('fdom'),    /* Ordering of fields (UInt8)*/
  711.     kImageCodecSettingsFieldOrderingF1F2 = 1,
  712.     kImageCodecSettingsFieldOrderingF2F1 = 2
  713. };
  714.  
  715. typedef CALLBACK_API( ComponentResult , ImageCodecMPDrawBandProcPtr )(void *refcon, ImageSubCodecDecompressRecord *drp);
  716. typedef STACK_UPP_TYPE(ImageCodecMPDrawBandProcPtr)             ImageCodecMPDrawBandUPP;
  717. enum { uppImageCodecMPDrawBandProcInfo = 0x000003F0 };             /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  718. #define NewImageCodecMPDrawBandProc(userRoutine)                 (ImageCodecMPDrawBandUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppImageCodecMPDrawBandProcInfo, GetCurrentArchitecture())
  719. #define CallImageCodecMPDrawBandProc(userRoutine, refcon, drp)     CALL_TWO_PARAMETER_UPP((userRoutine), uppImageCodecMPDrawBandProcInfo, (refcon), (drp))
  720. /*    codec selectors 0-127 are reserved by Apple */
  721. /*    codec selectors 128-191 are subtype specific */
  722. /*    codec selectors 192-255 are vendor specific */
  723. /*    codec selectors 256-32767 are available for general use */
  724. /*    negative selectors are reserved by the Component Manager */
  725. EXTERN_API( ComponentResult )
  726. ImageCodecGetCodecInfo            (ComponentInstance         ci,
  727.                                  CodecInfo *            info)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0000, 0x7000, 0xA82A);
  728.  
  729. EXTERN_API( ComponentResult )
  730. ImageCodecGetCompressionTime    (ComponentInstance         ci,
  731.                                  PixMapHandle             src,
  732.                                  const Rect *            srcRect,
  733.                                  short                     depth,
  734.                                  CodecQ *                spatialQuality,
  735.                                  CodecQ *                temporalQuality,
  736.                                  unsigned long *        time)                                FIVEWORDINLINE(0x2F3C, 0x0016, 0x0001, 0x7000, 0xA82A);
  737.  
  738. EXTERN_API( ComponentResult )
  739. ImageCodecGetMaxCompressionSize    (ComponentInstance         ci,
  740.                                  PixMapHandle             src,
  741.                                  const Rect *            srcRect,
  742.                                  short                     depth,
  743.                                  CodecQ                 quality,
  744.                                  long *                    size)                                FIVEWORDINLINE(0x2F3C, 0x0012, 0x0002, 0x7000, 0xA82A);
  745.  
  746. EXTERN_API( ComponentResult )
  747. ImageCodecPreCompress            (ComponentInstance         ci,
  748.                                  CodecCompressParams *    params)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0003, 0x7000, 0xA82A);
  749.  
  750. EXTERN_API( ComponentResult )
  751. ImageCodecBandCompress            (ComponentInstance         ci,
  752.                                  CodecCompressParams *    params)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  753.  
  754. EXTERN_API( ComponentResult )
  755. ImageCodecPreDecompress            (ComponentInstance         ci,
  756.                                  CodecDecompressParams * params)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  757.  
  758. EXTERN_API( ComponentResult )
  759. ImageCodecBandDecompress        (ComponentInstance         ci,
  760.                                  CodecDecompressParams * params)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0006, 0x7000, 0xA82A);
  761.  
  762. EXTERN_API( ComponentResult )
  763. ImageCodecBusy                    (ComponentInstance         ci,
  764.                                  ImageSequence             seq)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  765.  
  766. EXTERN_API( ComponentResult )
  767. ImageCodecGetCompressedImageSize (ComponentInstance     ci,
  768.                                  ImageDescriptionHandle  desc,
  769.                                  Ptr                     data,
  770.                                  long                     bufferSize,
  771.                                  ICMDataProcRecordPtr     dataProc,
  772.                                  long *                    dataSize)                            FIVEWORDINLINE(0x2F3C, 0x0014, 0x0008, 0x7000, 0xA82A);
  773.  
  774. EXTERN_API( ComponentResult )
  775. ImageCodecGetSimilarity            (ComponentInstance         ci,
  776.                                  PixMapHandle             src,
  777.                                  const Rect *            srcRect,
  778.                                  ImageDescriptionHandle  desc,
  779.                                  Ptr                     data,
  780.                                  Fixed *                similarity)                            FIVEWORDINLINE(0x2F3C, 0x0014, 0x0009, 0x7000, 0xA82A);
  781.  
  782. EXTERN_API( ComponentResult )
  783. ImageCodecTrimImage                (ComponentInstance         ci,
  784.                                  ImageDescriptionHandle  Desc,
  785.                                  Ptr                     inData,
  786.                                  long                     inBufferSize,
  787.                                  ICMDataProcRecordPtr     dataProc,
  788.                                  Ptr                     outData,
  789.                                  long                     outBufferSize,
  790.                                  ICMFlushProcRecordPtr     flushProc,
  791.                                  Rect *                    trimRect,
  792.                                  ICMProgressProcRecordPtr  progressProc)                    FIVEWORDINLINE(0x2F3C, 0x0024, 0x000A, 0x7000, 0xA82A);
  793.  
  794. EXTERN_API( ComponentResult )
  795. ImageCodecRequestSettings        (ComponentInstance         ci,
  796.                                  Handle                 settings,
  797.                                  Rect *                    rp,
  798.                                  ModalFilterUPP         filterProc)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x000B, 0x7000, 0xA82A);
  799.  
  800. EXTERN_API( ComponentResult )
  801. ImageCodecGetSettings            (ComponentInstance         ci,
  802.                                  Handle                 settings)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  803.  
  804. EXTERN_API( ComponentResult )
  805. ImageCodecSetSettings            (ComponentInstance         ci,
  806.                                  Handle                 settings)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x000D, 0x7000, 0xA82A);
  807.  
  808. EXTERN_API( ComponentResult )
  809. ImageCodecFlush                    (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x000E, 0x7000, 0xA82A);
  810.  
  811. EXTERN_API( ComponentResult )
  812. ImageCodecSetTimeCode            (ComponentInstance         ci,
  813.                                  void *                    timeCodeFormat,
  814.                                  void *                    timeCodeTime)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x000F, 0x7000, 0xA82A);
  815.  
  816. EXTERN_API( ComponentResult )
  817. ImageCodecIsImageDescriptionEquivalent (ComponentInstance  ci,
  818.                                  ImageDescriptionHandle  newDesc,
  819.                                  Boolean *                equivalent)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0010, 0x7000, 0xA82A);
  820.  
  821. EXTERN_API( ComponentResult )
  822. ImageCodecNewMemory                (ComponentInstance         ci,
  823.                                  Ptr *                    data,
  824.                                  Size                     dataSize,
  825.                                  long                     dataUse,
  826.                                  ICMMemoryDisposedUPP     memoryGoneProc,
  827.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0014, 0x0011, 0x7000, 0xA82A);
  828.  
  829. EXTERN_API( ComponentResult )
  830. ImageCodecDisposeMemory            (ComponentInstance         ci,
  831.                                  Ptr                     data)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0012, 0x7000, 0xA82A);
  832.  
  833. EXTERN_API( ComponentResult )
  834. ImageCodecHitTestData            (ComponentInstance         ci,
  835.                                  ImageDescriptionHandle  desc,
  836.                                  void *                    data,
  837.                                  Size                     dataSize,
  838.                                  Point                     where,
  839.                                  Boolean *                hit)                                FIVEWORDINLINE(0x2F3C, 0x0014, 0x0013, 0x7000, 0xA82A);
  840.  
  841. EXTERN_API( ComponentResult )
  842. ImageCodecNewImageBufferMemory    (ComponentInstance         ci,
  843.                                  CodecDecompressParams * params,
  844.                                  long                     flags,
  845.                                  ICMMemoryDisposedUPP     memoryGoneProc,
  846.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0010, 0x0014, 0x7000, 0xA82A);
  847.  
  848. EXTERN_API( ComponentResult )
  849. ImageCodecExtractAndCombineFields (ComponentInstance     ci,
  850.                                  long                     fieldFlags,
  851.                                  void *                    data1,
  852.                                  long                     dataSize1,
  853.                                  ImageDescriptionHandle  desc1,
  854.                                  void *                    data2,
  855.                                  long                     dataSize2,
  856.                                  ImageDescriptionHandle  desc2,
  857.                                  void *                    outputData,
  858.                                  long *                    outDataSize,
  859.                                  ImageDescriptionHandle  descOut)                            FIVEWORDINLINE(0x2F3C, 0x0028, 0x0015, 0x7000, 0xA82A);
  860.  
  861. EXTERN_API( ComponentResult )
  862. ImageCodecGetMaxCompressionSizeWithSources (ComponentInstance  ci,
  863.                                  PixMapHandle             src,
  864.                                  const Rect *            srcRect,
  865.                                  short                     depth,
  866.                                  CodecQ                 quality,
  867.                                  CDSequenceDataSourcePtr  sourceData,
  868.                                  long *                    size)                                FIVEWORDINLINE(0x2F3C, 0x0016, 0x0016, 0x7000, 0xA82A);
  869.  
  870. EXTERN_API( ComponentResult )
  871. ImageCodecSetTimeBase            (ComponentInstance         ci,
  872.                                  void *                    base)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0017, 0x7000, 0xA82A);
  873.  
  874. EXTERN_API( ComponentResult )
  875. ImageCodecSourceChanged            (ComponentInstance         ci,
  876.                                  UInt32                 majorSourceChangeSeed,
  877.                                  UInt32                 minorSourceChangeSeed,
  878.                                  CDSequenceDataSourcePtr  sourceData,
  879.                                  long *                    flagsOut)                            FIVEWORDINLINE(0x2F3C, 0x0010, 0x0018, 0x7000, 0xA82A);
  880.  
  881. EXTERN_API( ComponentResult )
  882. ImageCodecFlushFrame            (ComponentInstance         ci,
  883.                                  UInt32                 flags)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0019, 0x7000, 0xA82A);
  884.  
  885. EXTERN_API( ComponentResult )
  886. ImageCodecGetSettingsAsText        (ComponentInstance         ci,
  887.                                  Handle *                text)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x001A, 0x7000, 0xA82A);
  888.  
  889. EXTERN_API( ComponentResult )
  890. ImageCodecGetParameterListHandle (ComponentInstance     ci,
  891.                                  Handle *                parameterDescriptionHandle)            FIVEWORDINLINE(0x2F3C, 0x0004, 0x001B, 0x7000, 0xA82A);
  892.  
  893. EXTERN_API( ComponentResult )
  894. ImageCodecGetParameterList        (ComponentInstance         ci,
  895.                                  QTAtomContainer *        parameterDescription)                FIVEWORDINLINE(0x2F3C, 0x0004, 0x001C, 0x7000, 0xA82A);
  896.  
  897. EXTERN_API( ComponentResult )
  898. ImageCodecCreateStandardParameterDialog (ComponentInstance  ci,
  899.                                  QTAtomContainer         parameterDescription,
  900.                                  QTAtomContainer         parameters,
  901.                                  QTParameterDialogOptions  dialogOptions,
  902.                                  DialogPtr                 existingDialog,
  903.                                  short                     existingUserItem,
  904.                                  QTParameterDialog *    createdDialog)                        FIVEWORDINLINE(0x2F3C, 0x0016, 0x001D, 0x7000, 0xA82A);
  905.  
  906. EXTERN_API( ComponentResult )
  907. ImageCodecIsStandardParameterDialogEvent (ComponentInstance  ci,
  908.                                  EventRecord *            pEvent,
  909.                                  QTParameterDialog         createdDialog)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x001E, 0x7000, 0xA82A);
  910.  
  911. EXTERN_API( ComponentResult )
  912. ImageCodecDismissStandardParameterDialog (ComponentInstance  ci,
  913.                                  QTParameterDialog         createdDialog)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x001F, 0x7000, 0xA82A);
  914.  
  915. EXTERN_API( ComponentResult )
  916. ImageCodecStandardParameterDialogDoAction (ComponentInstance  ci,
  917.                                  QTParameterDialog         createdDialog,
  918.                                  long                     action,
  919.                                  void *                    params)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0020, 0x7000, 0xA82A);
  920.  
  921. EXTERN_API( ComponentResult )
  922. ImageCodecNewImageGWorld        (ComponentInstance         ci,
  923.                                  CodecDecompressParams * params,
  924.                                  GWorldPtr *            newGW,
  925.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0021, 0x7000, 0xA82A);
  926.  
  927. EXTERN_API( ComponentResult )
  928. ImageCodecDisposeImageGWorld    (ComponentInstance         ci,
  929.                                  GWorldPtr                 theGW)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0022, 0x7000, 0xA82A);
  930.  
  931. EXTERN_API( ComponentResult )
  932. ImageCodecHitTestDataWithFlags    (ComponentInstance         ci,
  933.                                  ImageDescriptionHandle  desc,
  934.                                  void *                    data,
  935.                                  Size                     dataSize,
  936.                                  Point                     where,
  937.                                  long *                    hit,
  938.                                  long                     hitFlags)                            FIVEWORDINLINE(0x2F3C, 0x0018, 0x0023, 0x7000, 0xA82A);
  939.  
  940. EXTERN_API( ComponentResult )
  941. ImageCodecValidateParameters    (ComponentInstance         ci,
  942.                                  QTAtomContainer         parameters,
  943.                                  QTParameterValidationOptions  validationFlags,
  944.                                  StringPtr                 errorString)                        FIVEWORDINLINE(0x2F3C, 0x000C, 0x0024, 0x7000, 0xA82A);
  945.  
  946. EXTERN_API( ComponentResult )
  947. ImageCodecGetBaseMPWorkFunction    (ComponentInstance         ci,
  948.                                  ComponentMPWorkFunctionUPP * workFunction,
  949.                                  void **                refCon,
  950.                                  ImageCodecMPDrawBandUPP  drawProc,
  951.                                  void *                    drawProcRefCon)                        FIVEWORDINLINE(0x2F3C, 0x0010, 0x0025, 0x7000, 0xA82A);
  952.  
  953. EXTERN_API( ComponentResult )
  954. ImageCodecPreflight                (ComponentInstance         ci,
  955.                                  CodecDecompressParams * params)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0200, 0x7000, 0xA82A);
  956.  
  957. EXTERN_API( ComponentResult )
  958. ImageCodecInitialize            (ComponentInstance         ci,
  959.                                  ImageSubCodecDecompressCapabilities * cap)                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0201, 0x7000, 0xA82A);
  960.  
  961. EXTERN_API( ComponentResult )
  962. ImageCodecBeginBand                (ComponentInstance         ci,
  963.                                  CodecDecompressParams * params,
  964.                                  ImageSubCodecDecompressRecord * drp,
  965.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0202, 0x7000, 0xA82A);
  966.  
  967. EXTERN_API( ComponentResult )
  968. ImageCodecDrawBand                (ComponentInstance         ci,
  969.                                  ImageSubCodecDecompressRecord * drp)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0203, 0x7000, 0xA82A);
  970.  
  971. EXTERN_API( ComponentResult )
  972. ImageCodecEndBand                (ComponentInstance         ci,
  973.                                  ImageSubCodecDecompressRecord * drp,
  974.                                  OSErr                     result,
  975.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x000A, 0x0204, 0x7000, 0xA82A);
  976.  
  977. EXTERN_API( ComponentResult )
  978. ImageCodecQueueStarting            (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0205, 0x7000, 0xA82A);
  979.  
  980. EXTERN_API( ComponentResult )
  981. ImageCodecQueueStopping            (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0206, 0x7000, 0xA82A);
  982.  
  983. EXTERN_API( ComponentResult )
  984. ImageCodecDroppingFrame            (ComponentInstance         ci,
  985.                                  const ImageSubCodecDecompressRecord * drp)                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0207, 0x7000, 0xA82A);
  986.  
  987.  
  988.  
  989.  
  990. /* selectors for component calls */
  991. enum {
  992.     kImageCodecGetCodecInfoSelect                    = 0x0000,
  993.     kImageCodecGetCompressionTimeSelect                = 0x0001,
  994.     kImageCodecGetMaxCompressionSizeSelect            = 0x0002,
  995.     kImageCodecPreCompressSelect                    = 0x0003,
  996.     kImageCodecBandCompressSelect                    = 0x0004,
  997.     kImageCodecPreDecompressSelect                    = 0x0005,
  998.     kImageCodecBandDecompressSelect                    = 0x0006,
  999.     kImageCodecBusySelect                            = 0x0007,
  1000.     kImageCodecGetCompressedImageSizeSelect            = 0x0008,
  1001.     kImageCodecGetSimilaritySelect                    = 0x0009,
  1002.     kImageCodecTrimImageSelect                        = 0x000A,
  1003.     kImageCodecRequestSettingsSelect                = 0x000B,
  1004.     kImageCodecGetSettingsSelect                    = 0x000C,
  1005.     kImageCodecSetSettingsSelect                    = 0x000D,
  1006.     kImageCodecFlushSelect                            = 0x000E,
  1007.     kImageCodecSetTimeCodeSelect                    = 0x000F,
  1008.     kImageCodecIsImageDescriptionEquivalentSelect    = 0x0010,
  1009.     kImageCodecNewMemorySelect                        = 0x0011,
  1010.     kImageCodecDisposeMemorySelect                    = 0x0012,
  1011.     kImageCodecHitTestDataSelect                    = 0x0013,
  1012.     kImageCodecNewImageBufferMemorySelect            = 0x0014,
  1013.     kImageCodecExtractAndCombineFieldsSelect        = 0x0015,
  1014.     kImageCodecGetMaxCompressionSizeWithSourcesSelect = 0x0016,
  1015.     kImageCodecSetTimeBaseSelect                    = 0x0017,
  1016.     kImageCodecSourceChangedSelect                    = 0x0018,
  1017.     kImageCodecFlushFrameSelect                        = 0x0019,
  1018.     kImageCodecGetSettingsAsTextSelect                = 0x001A,
  1019.     kImageCodecGetParameterListHandleSelect            = 0x001B,
  1020.     kImageCodecGetParameterListSelect                = 0x001C,
  1021.     kImageCodecCreateStandardParameterDialogSelect = 0x001D,
  1022.     kImageCodecIsStandardParameterDialogEventSelect = 0x001E,
  1023.     kImageCodecDismissStandardParameterDialogSelect = 0x001F,
  1024.     kImageCodecStandardParameterDialogDoActionSelect = 0x0020,
  1025.     kImageCodecNewImageGWorldSelect                    = 0x0021,
  1026.     kImageCodecDisposeImageGWorldSelect                = 0x0022,
  1027.     kImageCodecHitTestDataWithFlagsSelect            = 0x0023,
  1028.     kImageCodecValidateParametersSelect                = 0x0024,
  1029.     kImageCodecGetBaseMPWorkFunctionSelect            = 0x0025,
  1030.     kImageCodecPreflightSelect                        = 0x0200,
  1031.     kImageCodecInitializeSelect                        = 0x0201,
  1032.     kImageCodecBeginBandSelect                        = 0x0202,
  1033.     kImageCodecDrawBandSelect                        = 0x0203,
  1034.     kImageCodecEndBandSelect                        = 0x0204,
  1035.     kImageCodecQueueStartingSelect                    = 0x0205,
  1036.     kImageCodecQueueStoppingSelect                    = 0x0206,
  1037.     kImageCodecDroppingFrameSelect                    = 0x0207
  1038. };
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049. enum {
  1050.     kMotionJPEGTag                = FOUR_CHAR_CODE('mjpg'),
  1051.     kJPEGQuantizationTablesImageDescriptionExtension = FOUR_CHAR_CODE('mjqt'),
  1052.     kJPEGHuffmanTablesImageDescriptionExtension = FOUR_CHAR_CODE('mjht'),
  1053.     kFieldInfoImageDescriptionExtension = FOUR_CHAR_CODE('fiel') /* image description extension describing the field count and field orderings*/
  1054. };
  1055.  
  1056.  
  1057. enum {
  1058.     kFieldOrderUnknown            = 0,
  1059.     kFieldsStoredF1F2DisplayedF1F2 = 1,
  1060.     kFieldsStoredF1F2DisplayedF2F1 = 2,
  1061.     kFieldsStoredF2F1DisplayedF1F2 = 5,
  1062.     kFieldsStoredF2F1DisplayedF2F1 = 6
  1063. };
  1064.  
  1065.  
  1066. struct MotionJPEGApp1Marker {
  1067.     long                             unused;
  1068.     long                             tag;
  1069.     long                             fieldSize;
  1070.     long                             paddedFieldSize;
  1071.     long                             offsetToNextField;
  1072.     long                             qTableOffset;
  1073.     long                             huffmanTableOffset;
  1074.     long                             sofOffset;
  1075.     long                             sosOffset;
  1076.     long                             soiOffset;
  1077. };
  1078. typedef struct MotionJPEGApp1Marker        MotionJPEGApp1Marker;
  1079.  
  1080. struct FieldInfoImageDescriptionExtension {
  1081.     UInt8                             fieldCount;
  1082.     UInt8                             fieldOrderings;
  1083. };
  1084. typedef struct FieldInfoImageDescriptionExtension FieldInfoImageDescriptionExtension;
  1085.  
  1086. EXTERN_API( ComponentResult )
  1087. QTPhotoSetSampling                (ComponentInstance         codec,
  1088.                                  short                     yH,
  1089.                                  short                     yV,
  1090.                                  short                     cbH,
  1091.                                  short                     cbV,
  1092.                                  short                     crH,
  1093.                                  short                     crV)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0100, 0x7000, 0xA82A);
  1094.  
  1095. EXTERN_API( ComponentResult )
  1096. QTPhotoSetRestartInterval        (ComponentInstance         codec,
  1097.                                  unsigned short         restartInterval)                    FIVEWORDINLINE(0x2F3C, 0x0002, 0x0101, 0x7000, 0xA82A);
  1098.  
  1099. EXTERN_API( ComponentResult )
  1100. QTPhotoDefineHuffmanTable        (ComponentInstance         codec,
  1101.                                  short                     componentNumber,
  1102.                                  Boolean                 isDC,
  1103.                                  unsigned char *        lengthCounts,
  1104.                                  unsigned char *        values)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0102, 0x7000, 0xA82A);
  1105.  
  1106. EXTERN_API( ComponentResult )
  1107. QTPhotoDefineQuantizationTable    (ComponentInstance         codec,
  1108.                                  short                     componentNumber,
  1109.                                  unsigned char *        table)                                FIVEWORDINLINE(0x2F3C, 0x0006, 0x0103, 0x7000, 0xA82A);
  1110.  
  1111.  
  1112. /* selectors for component calls */
  1113. enum {
  1114.     kQTPhotoSetSamplingSelect                        = 0x0100,
  1115.     kQTPhotoSetRestartIntervalSelect                = 0x0101,
  1116.     kQTPhotoDefineHuffmanTableSelect                = 0x0102,
  1117.     kQTPhotoDefineQuantizationTableSelect            = 0x0103
  1118. };
  1119.  
  1120.  
  1121.  
  1122.  
  1123. /* source identifier -- placed in root container of description, one or more required */
  1124.  
  1125. enum {
  1126.     kEffectSourceName            = FOUR_CHAR_CODE('src ')
  1127. };
  1128.  
  1129.  
  1130. /* source type -- placed in the input map to identify the source kind */
  1131.  
  1132. enum {
  1133.     kEffectDataSourceType        = FOUR_CHAR_CODE('dtst')
  1134. };
  1135.  
  1136. /*  default effect types */
  1137.  
  1138. enum {
  1139.     kEffectRawSource            = 0,                            /* the source is raw image data*/
  1140.     kEffectGenericType            = FOUR_CHAR_CODE('geff')        /* generic effect for combining others*/
  1141. };
  1142.  
  1143. typedef struct EffectSource             EffectSource;
  1144.  
  1145. typedef EffectSource *                    EffectSourcePtr;
  1146.  
  1147. union SourceData {
  1148.     CDSequenceDataSourcePtr         image;
  1149.     EffectSourcePtr                 effect;
  1150. };
  1151. typedef union SourceData                SourceData;
  1152.  
  1153.  
  1154. struct EffectSource {
  1155.     long                             effectType;                    /* type of effect or kEffectRawSource if raw ICM data*/
  1156.     Ptr                             data;                        /* track data for this effect*/
  1157.     SourceData                         source;                        /* source/effect pointers*/
  1158.     EffectSourcePtr                 next;                        /* the next source for the parent effect*/
  1159. };
  1160.  
  1161.  
  1162. struct EffectsFrameParams {
  1163.     ICMFrameTimeRecord                 frameTime;                    /* timing data*/
  1164.     long                             effectDuration;                /* the duration of a single effect frame*/
  1165.     Boolean                         doAsync;                    /* set to true if the effect can go async*/
  1166.     unsigned char                     pad[3];
  1167.     EffectSourcePtr                 source;                        /* ptr to the source input tree*/
  1168.     void *                            refCon;                        /* storage for the effect*/
  1169. };
  1170. typedef struct EffectsFrameParams        EffectsFrameParams;
  1171. typedef EffectsFrameParams *            EffectsFrameParamsPtr;
  1172.  
  1173.  
  1174. EXTERN_API( ComponentResult )
  1175. ImageCodecEffectSetup            (ComponentInstance         effect,
  1176.                                  CodecDecompressParams * p)                                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0300, 0x7000, 0xA82A);
  1177.  
  1178. EXTERN_API( ComponentResult )
  1179. ImageCodecEffectBegin            (ComponentInstance         effect,
  1180.                                  CodecDecompressParams * p,
  1181.                                  EffectsFrameParamsPtr     ePtr)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0301, 0x7000, 0xA82A);
  1182.  
  1183. EXTERN_API( ComponentResult )
  1184. ImageCodecEffectRenderFrame        (ComponentInstance         effect,
  1185.                                  EffectsFrameParamsPtr     p)                                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0302, 0x7000, 0xA82A);
  1186.  
  1187. EXTERN_API( ComponentResult )
  1188. ImageCodecEffectConvertEffectSourceToFormat (ComponentInstance  effect,
  1189.                                  EffectSourcePtr         sourceToConvert,
  1190.                                  ImageDescriptionHandle  requestedDesc)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x0303, 0x7000, 0xA82A);
  1191.  
  1192. EXTERN_API( ComponentResult )
  1193. ImageCodecEffectCancel            (ComponentInstance         effect,
  1194.                                  EffectsFrameParamsPtr     p)                                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0304, 0x7000, 0xA82A);
  1195.  
  1196. EXTERN_API( ComponentResult )
  1197. ImageCodecEffectGetSpeed        (ComponentInstance         effect,
  1198.                                  QTAtomContainer         parameters,
  1199.                                  Fixed *                pFPS)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0305, 0x7000, 0xA82A);
  1200.  
  1201.  
  1202.  
  1203. /* selectors for component calls */
  1204. enum {
  1205.     kImageCodecEffectSetupSelect                    = 0x0300,
  1206.     kImageCodecEffectBeginSelect                    = 0x0301,
  1207.     kImageCodecEffectRenderFrameSelect                = 0x0302,
  1208.     kImageCodecEffectConvertEffectSourceToFormatSelect = 0x0303,
  1209.     kImageCodecEffectCancelSelect                    = 0x0304,
  1210.     kImageCodecEffectGetSpeedSelect                    = 0x0305
  1211. };
  1212.  
  1213.  
  1214. /* curve atom types and data structures */
  1215.  
  1216. enum {
  1217.     kCurvePathAtom                = FOUR_CHAR_CODE('path'),
  1218.     kCurveEndAtom                = FOUR_CHAR_CODE('zero'),
  1219.     kCurveAntialiasControlAtom    = FOUR_CHAR_CODE('anti'),
  1220.     kCurveAntialiasOff            = 0,
  1221.     kCurveAntialiasOn            = (long)0xFFFFFFFF,
  1222.     kCurveFillTypeAtom            = FOUR_CHAR_CODE('fill'),
  1223.     kCurvePenThicknessAtom        = FOUR_CHAR_CODE('pent'),
  1224.     kCurveMiterLimitAtom        = FOUR_CHAR_CODE('mitr'),
  1225.     kCurveJoinAttributesAtom    = FOUR_CHAR_CODE('join'),
  1226.     kCurveMinimumDepthAtom        = FOUR_CHAR_CODE('mind'),
  1227.     kCurveDepthAlwaysOffscreenMask = (long)0x80000000,
  1228.     kCurveTransferModeAtom        = FOUR_CHAR_CODE('xfer'),
  1229.     kCurveGradientAngleAtom        = FOUR_CHAR_CODE('angl'),
  1230.     kCurveGradientRadiusAtom    = FOUR_CHAR_CODE('radi'),
  1231.     kCurveGradientOffsetAtom    = FOUR_CHAR_CODE('cent')
  1232. };
  1233.  
  1234.  
  1235. enum {
  1236.     kCurveARGBColorAtom            = FOUR_CHAR_CODE('argb')
  1237. };
  1238.  
  1239.  
  1240. struct ARGBColor {
  1241.     unsigned short                     alpha;
  1242.     unsigned short                     red;
  1243.     unsigned short                     green;
  1244.     unsigned short                     blue;
  1245. };
  1246. typedef struct ARGBColor                ARGBColor;
  1247.  
  1248. enum {
  1249.     kCurveGradientRecordAtom    = FOUR_CHAR_CODE('grad')
  1250. };
  1251.  
  1252.  
  1253. struct GradientColorRecord {
  1254.     ARGBColor                         thisColor;
  1255.     Fixed                             endingPercentage;
  1256. };
  1257. typedef struct GradientColorRecord        GradientColorRecord;
  1258.  
  1259. typedef GradientColorRecord *            GradientColorPtr;
  1260.  
  1261. enum {
  1262.     kCurveGradientTypeAtom        = FOUR_CHAR_CODE('grdt')
  1263. };
  1264.  
  1265. /* currently supported gradient types */
  1266.  
  1267. enum {
  1268.     kLinearGradient                = 0,
  1269.     kCircularGradient            = 1
  1270. };
  1271.  
  1272. typedef long                             GradientType;
  1273. EXTERN_API( ComponentResult )
  1274. CurveGetLength                    (ComponentInstance         effect,
  1275.                                  gxPaths *                target,
  1276.                                  long                     index,
  1277.                                  wide *                    wideLength)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0100, 0x7000, 0xA82A);
  1278.  
  1279. EXTERN_API( ComponentResult )
  1280. CurveLengthToPoint                (ComponentInstance         effect,
  1281.                                  gxPaths *                target,
  1282.                                  long                     index,
  1283.                                  Fixed                     length,
  1284.                                  FixedPoint *            location,
  1285.                                  FixedPoint *            tangent)                            FIVEWORDINLINE(0x2F3C, 0x0014, 0x0101, 0x7000, 0xA82A);
  1286.  
  1287. EXTERN_API( ComponentResult )
  1288. CurveNewPath                    (ComponentInstance         effect,
  1289.                                  Handle *                pPath)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0102, 0x7000, 0xA82A);
  1290.  
  1291. EXTERN_API( ComponentResult )
  1292. CurveCountPointsInPath            (ComponentInstance         effect,
  1293.                                  gxPaths *                aPath,
  1294.                                  unsigned long             contourIndex,
  1295.                                  unsigned long *        pCount)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0103, 0x7000, 0xA82A);
  1296.  
  1297. EXTERN_API( ComponentResult )
  1298. CurveGetPathPoint                (ComponentInstance         effect,
  1299.                                  gxPaths *                aPath,
  1300.                                  unsigned long             contourIndex,
  1301.                                  unsigned long             pointIndex,
  1302.                                  gxPoint *                thePoint,
  1303.                                  Boolean *                ptIsOnPath)                            FIVEWORDINLINE(0x2F3C, 0x0014, 0x0104, 0x7000, 0xA82A);
  1304.  
  1305. EXTERN_API( ComponentResult )
  1306. CurveInsertPointIntoPath        (ComponentInstance         effect,
  1307.                                  gxPoint *                aPoint,
  1308.                                  Handle                 thePath,
  1309.                                  unsigned long             contourIndex,
  1310.                                  unsigned long             pointIndex,
  1311.                                  Boolean                 ptIsOnPath)                            FIVEWORDINLINE(0x2F3C, 0x0012, 0x0105, 0x7000, 0xA82A);
  1312.  
  1313. EXTERN_API( ComponentResult )
  1314. CurveSetPathPoint                (ComponentInstance         effect,
  1315.                                  gxPaths *                aPath,
  1316.                                  unsigned long             contourIndex,
  1317.                                  unsigned long             pointIndex,
  1318.                                  gxPoint *                thePoint,
  1319.                                  Boolean                 ptIsOnPath)                            FIVEWORDINLINE(0x2F3C, 0x0012, 0x0106, 0x7000, 0xA82A);
  1320.  
  1321. EXTERN_API( ComponentResult )
  1322. CurveGetNearestPathPoint        (ComponentInstance         effect,
  1323.                                  gxPaths *                aPath,
  1324.                                  FixedPoint *            thePoint,
  1325.                                  unsigned long *        contourIndex,
  1326.                                  unsigned long *        pointIndex,
  1327.                                  Fixed *                theDelta)                            FIVEWORDINLINE(0x2F3C, 0x0014, 0x0107, 0x7000, 0xA82A);
  1328.  
  1329. EXTERN_API( ComponentResult )
  1330. CurvePathPointToLength            (ComponentInstance         ci,
  1331.                                  gxPaths *                aPath,
  1332.                                  Fixed                     startDist,
  1333.                                  Fixed                     endDist,
  1334.                                  FixedPoint *            thePoint,
  1335.                                  Fixed *                pLength)                            FIVEWORDINLINE(0x2F3C, 0x0014, 0x0108, 0x7000, 0xA82A);
  1336.  
  1337. EXTERN_API( ComponentResult )
  1338. CurveCreateVectorStream            (ComponentInstance         effect,
  1339.                                  Handle *                pStream)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0109, 0x7000, 0xA82A);
  1340.  
  1341. EXTERN_API( ComponentResult )
  1342. CurveAddAtomToVectorStream        (ComponentInstance         effect,
  1343.                                  OSType                 atomType,
  1344.                                  Size                     atomSize,
  1345.                                  void *                    pAtomData,
  1346.                                  Handle                 vectorStream)                        FIVEWORDINLINE(0x2F3C, 0x0010, 0x010A, 0x7000, 0xA82A);
  1347.  
  1348. EXTERN_API( ComponentResult )
  1349. CurveAddPathAtomToVectorStream    (ComponentInstance         effect,
  1350.                                  Handle                 pathData,
  1351.                                  Handle                 vectorStream)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x010B, 0x7000, 0xA82A);
  1352.  
  1353. EXTERN_API( ComponentResult )
  1354. CurveAddZeroAtomToVectorStream    (ComponentInstance         effect,
  1355.                                  Handle                 vectorStream)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x010C, 0x7000, 0xA82A);
  1356.  
  1357. EXTERN_API( ComponentResult )
  1358. CurveGetAtomDataFromVectorStream (ComponentInstance     effect,
  1359.                                  Handle                 vectorStream,
  1360.                                  long                     atomType,
  1361.                                  long *                    dataSize,
  1362.                                  Ptr *                    dataPtr)                            FIVEWORDINLINE(0x2F3C, 0x0010, 0x010D, 0x7000, 0xA82A);
  1363.  
  1364.  
  1365.  
  1366. /* selectors for component calls */
  1367. enum {
  1368.     kCurveGetLengthSelect                            = 0x0100,
  1369.     kCurveLengthToPointSelect                        = 0x0101,
  1370.     kCurveNewPathSelect                                = 0x0102,
  1371.     kCurveCountPointsInPathSelect                    = 0x0103,
  1372.     kCurveGetPathPointSelect                        = 0x0104,
  1373.     kCurveInsertPointIntoPathSelect                    = 0x0105,
  1374.     kCurveSetPathPointSelect                        = 0x0106,
  1375.     kCurveGetNearestPathPointSelect                    = 0x0107,
  1376.     kCurvePathPointToLengthSelect                    = 0x0108,
  1377.     kCurveCreateVectorStreamSelect                    = 0x0109,
  1378.     kCurveAddAtomToVectorStreamSelect                = 0x010A,
  1379.     kCurveAddPathAtomToVectorStreamSelect            = 0x010B,
  1380.     kCurveAddZeroAtomToVectorStreamSelect            = 0x010C,
  1381.     kCurveGetAtomDataFromVectorStreamSelect            = 0x010D
  1382. };
  1383. /* UPP call backs */
  1384.  
  1385. #if PRAGMA_STRUCT_ALIGN
  1386.     #pragma options align=reset
  1387. #elif PRAGMA_STRUCT_PACKPUSH
  1388.     #pragma pack(pop)
  1389. #elif PRAGMA_STRUCT_PACK
  1390.     #pragma pack()
  1391. #endif
  1392.  
  1393. #ifdef PRAGMA_IMPORT_OFF
  1394. #pragma import off
  1395. #elif PRAGMA_IMPORT
  1396. #pragma import reset
  1397. #endif
  1398.  
  1399. #ifdef __cplusplus
  1400. }
  1401. #endif
  1402.  
  1403. #endif /* __IMAGECODEC__ */
  1404.  
  1405.